package com.zzzy.cont.controller.processcon;

import com.zzzy.common.vo.AjaxResult;
import com.zzzy.common.vo.PageResult;
import com.zzzy.cont.dao.entity.Contract;
import com.zzzy.cont.service.processcon.ProcessConService;
import com.zzzy.cont.vo.contract.process.ProcessConPageReq;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@Tag(name = "办理合同-已办合同", description = "con208")
@Validated
@RestController
@RequestMapping("/con/process")
public class ProcessedConController {

    @Resource
    private ProcessConService processConService;

    @Operation(summary = "分页列表")
    @GetMapping(value = "/processedPage")
    @PreAuthorize("@pvs.hasPermission('con:process:page')")
    public AjaxResult<PageResult<Contract>> processedPage(@Valid @ParameterObject ProcessConPageReq queryReq) {
        PageResult<Contract> docPage = processConService.getProcessedConPage(queryReq);
        return AjaxResult.success(docPage);
    }

}
